function videoHeight(container){
	var videoWindow = document.getElementsByClassName(container)[0];
	console.log([videoWindow])
	var cliHeight = document.documentElement.clientHeight;
	console.log("浏览器可视高",cliHeight)
	videoWindow.style.height = cliHeight+"px";
}
//导航栏背景透明/不透明
function navChange(){
	var header = document.getElementsByTagName("header")[0];
	addEventListener("scroll",function(e){
		setTimeout(function(){
//			console.log(e)
//			console.log(e.target.scrollingElement.offsetTop);
//			var targetEle = document.getElementsByClassName("banner2")[0]
//			console.log(targetEle.offsetTop,e.target.scrollingElement.scrollTop+80)
			
			var scrollTop=e.target.scrollingElement.scrollTop;
			if(scrollTop>0){
				header.classList.add("bg-color");
			}else{
				header.classList.remove("bg-color");
			}
		},100)
	})
}

//点击icon跳到指定位置
function clickIcon(){
	var isClick = false,
		header = document.getElementsByTagName("header")[0],
		icon = document.getElementsByClassName("icon-scroll")[0],
		targetEle = document.getElementsByClassName("banner2")[0],
		intervalId = 0;
		console.log(header.offsetHeight);
		icon.addEventListener("click",function(){
			if(!isClick){
				isClick = true;
				setTimeout(function(){
					isClick = false;
				},2000)
				console.log(document.scrollingElement.scrollTop);
				intervalId = setInterval(function(){
					
					document.scrollingElement.scrollTop+=50;
					if(targetEle.offsetTop<document.scrollingElement.scrollTop+80){
						clearInterval(intervalId);
					}
				},10)
				
			}
		})
}
//banner轮播图
function lunbo(){
	var displayEle = document.getElementsByClassName("big-pic")[0].children;
	var dot = document.getElementsByClassName("small-pic")[0].children;
	var intervalId = 0;
	var pic_index = 0;
	console.log(displayEle,dot);
	//点击展示
	function clickDisplay(){
		console.log(intervalId)
		
		Array.prototype.forEach.call(dot,function(item,index,arr){
		item.addEventListener("click",function(){
			clearInterval(intervalId);
			for(var i = 0;i<arr.length;i++){
				arr[i].classList.remove("li-act");
				displayEle[i].classList.remove("display");
			}
			this.classList.add("li-act");
			displayEle[index].classList.add("display");
			pic_index = index;
			autoPlay();
		})
	})
	}
	//自动播放
	function autoPlay(){
		intervalId = setInterval(function(){
			console.log(intervalId)
			pic_index++;
			if(pic_index>3){
				pic_index=0;
			}
			for(var i = 0;i<dot.length;i++){
				dot[i].classList.remove("li-act");
				displayEle[i].classList.remove("display");
			}
			dot[pic_index].classList.add("li-act");
			displayEle[pic_index].classList.add("display");
		},2000)
		
	}
	clickDisplay();
	setTimeout(autoPlay,2000);
	
}